package com.nari.ncps.screen.controller;

import com.nari.ncps.screen.common.pojo.ApiResponse;
import com.nari.ncps.screen.model.Monitor;
import com.nari.ncps.screen.service.MonitorService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * 全产业一体化-监控设备获取全部列表
 *
 * @author wanghuiqiang
 * @since 2025-10-26
 */
@Tag(name = "全产业一体化-监控设备获取全部列表", description = "全产业一体化-监控设备获取全部列表")
@RestController
@RequestMapping("/monitor")
public class MonitorController {

    @Resource
    private MonitorService monitorService;

    /**
     * 全产业一体化-监控设备获取全部列表
     * @param plateId 板块id
     * @return  监控设备获取全部列表
     */
    @Operation(summary = "全产业一体化-监控设备获取全部列表", description = "全产业一体化-监控设备获取全部列表")
    @GetMapping("/getMonitor")
    public ApiResponse<List<Monitor>> getMonitor(@RequestParam(value = "plateId", required = false) Integer plateId) {

        System.out.println("======== 全产业一体化-监控设备获取全部列表 ========");

        List<Monitor> result = monitorService.getMonitor(plateId);
//        List<Monitor> result =new ArrayList<>();
        return ApiResponse.succeed(result);
    }

}
